<?php echo HTML::plugins('datatables/dataTables.css');?>
<?php echo HTML::plugins('datatables/dataTables.bootstrap.css');?>
<?php echo HTML::plugins('datatables/jquery.dataTables.css');?>
<?php echo HTML::plugins('datatables/datatables.responsive.css');?>
<?php echo HTML::script('administracio.js');?>
<?php echo HTML::script('plugins/datatables/jquery.dataTables.js');?>
<?php echo HTML::script('plugins/datatables/dataTables.bootstrap.js');?>
<?php echo HTML::script('plugins/datatables/datatables.responsive.js');?>

	<div id="page-heading">
      <ol class="breadcrumb">
        <li><a href="/">Portada</a></li>
        <li>Registre</li>
        <li class="active">Mostrar logs</li>
      </ol>
    </div>
	<div class="container">
		<div class="row">
			<div class="col-md-12">
				<div class="panel ">
					<div class="panel-heading">
						<h4>Logs Error</h4>
						<div class="options">
			                <div class="btn-toolbar">
			                    <div class="btn-group hidden-xs">
			                        <a data-toggle="dropdown" class="btn btn-default dropdown-toggle" href="#"><i class="fa fa-cloud-download"></i><span class="hidden-sm"> Exportar </span></a>
			                        <ul class="dropdown-menu">
			                            <li><a href="javascript:alert('hola');">Excel File (*.xlsx)</a></li>
			                            <li><a href="#">PDF File (*.pdf)</a></li>
			                        </ul>
			                    </div>
			                </div>
			            </div>
					</div>
					<div class="panel-body collapse in">
						<div class="form-inline">
							<table id="logs" class="table table-striped table-bordered " cellspacing="0" width="100%">
								<thead>
									<tr>
										<th data-class="expand">ID</th>
										<th data-hide="phone,tablet">Tipo</th>
										<th data-hide="phone,tablet">Texto</th>
										<th data-hide="phone,tablet">Fecha</th>
										<th data-hide="phone,tablet">IP</th>
										<th data-hide="phone,tablet">Navegador</th>
										<th data-hide="phone,tablet">ID Usuario</th>
									</tr>
								</thead>
							</table>
						</div>
					</div>
				</div>
			</div>
		</div>
</div>
<script>

'use strict';

    var responsiveHelper = undefined;
    var breakpointDefinition = {
        tablet: 1024,
        phone : 480
    };
    
    var tableElement = $('#logs');

    tableElement.dataTable({
        autoWidth      : false,
        ajax           : url_base+'/get_all_logs',
        aaSorting: [[3, "desc" ]],
        preDrawCallback: function () {
            // Initialize the responsive datatables helper once.
            if (!responsiveHelper) {
                responsiveHelper = new ResponsiveDatatablesHelper(tableElement, breakpointDefinition);
            }
        },
        rowCallback    : function (nRow) {
            responsiveHelper.createExpandIcon(nRow);
        },
        drawCallback   : function (oSettings) {
            responsiveHelper.respond();
        }
    });

</script>
